package com.scm.erp.framework.repository;

import com.scm.erp.framework.pojo.netWorkImages;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public interface netWorkImagesRepository extends JpaRepository<netWorkImages,Long> {

    @Query(value = "select images.t_NImagesUrl from netWorkImages images where images.t_NImagesUrl=?1", nativeQuery = false)
    String findByNImagesUrl(String NImagesUrl);

    @Query(value = "select images.t_nimagesurl from t_networkimages images where images.t_nid = ?1 limit 1",nativeQuery = true)
    String findByCuntNImagesUrl(Long Nid);

    @Query(value = "select images1.t_NClassNavigation from netWorkImages images1 where images1.t_NID = (select max(images2.t_NID) from netWorkImages images2)",nativeQuery = false)
    String findMaxNClassNavigation();
    @Query(value = "select images1.t_NPages from netWorkImages images1 where images1.t_NID = (select max(images2.t_NID) from netWorkImages images2)",nativeQuery = false)
    String findMaxNClassNPage();
    @Query(value = "select images1.t_NID from netWorkImages images1 where images1.t_NID = (select max(images2.t_NID) from netWorkImages images2)",nativeQuery = false)
    Long findMaxNId();
    @Query(value = "select images.t_NID from netWorkImages images where images.t_NImagesUrl=?1",nativeQuery = false)
    Long findById(String NImagesUrl);


}
